//
//  NewChangePhoneNumberViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/30.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewChangePhoneNumberViewController.h"
#import "JTCSM.h"
#import "NewChangeHavePhoneViewController.h"
#import "newChangeNoPhoneViewController.h"

static CGFloat imagesize = 100;
static CGFloat top = 56+64;
@interface NewChangePhoneNumberViewController ()

@property (nonatomic,strong) UILabel *phoneLabel;
@end

@implementation NewChangePhoneNumberViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [df isRemoveTarbar:YES];
    self.navigationController.navigationBar.hidden = NO;
    self.view.backgroundColor =[UIColor whiteColor];
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    // Do any additional setup after loading the view.
    [self layoutSubviews];
}

- (void)layoutSubviews{
    
    CGFloat space = (KCONTROLLERWith-imagesize)/2;
    UIImageView *headerImageV = [[UIImageView alloc]initWithFrame:CGRectMake(space, top, imagesize, imagesize)];
    headerImageV.image = [UIImage imageNamed:@"更换登录手机号.png"];
    [self.view addSubview:headerImageV];
    
    _phoneLabel = [UILabel initWithFrame:CGRectMake(0, KVIEW_Y(headerImageV)+36, KCONTROLLERWith, 20) text:@"请确认此手机号133****0395" font:14 textAlignment:NSTextAlignmentCenter texcolor:[df colorWithHexString:@"666666" alpha:1] backgroundColor:nil];
    [self.view addSubview:_phoneLabel];
    
    UILabel *alertLabel = [UILabel initWithFrame:CGRectMake(0, KVIEW_Y(_phoneLabel), KCONTROLLERWith, 20) text:@"是否可以正常接收短信验证码" font:14 textAlignment:NSTextAlignmentCenter texcolor:[df colorWithHexString:@"666666" alpha:1] backgroundColor:nil];
    [self.view addSubview:alertLabel];
    
    CGFloat buttonspace = 55;
    CGFloat changespace = 40;
    CGFloat buttonWidth = (KCONTROLLERWith-2*buttonspace-changespace)/2;
    CGFloat buttonHeight = buttonWidth*0.45;
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    leftButton.frame = CGRectMake(buttonspace, KVIEW_Y(alertLabel)+50, buttonWidth, buttonHeight);
    [leftButton addTarget:self action:@selector(canrecieve) forControlEvents:UIControlEventTouchUpInside];
    [df layerWithView:leftButton radius:leftButton.LC_height/2 width:1 color:KZhuTiRGB];
    [leftButton setTitleColor:RGBACOLOR(51, 51, 51, 1) forState:UIControlStateNormal];
    [leftButton setTitle:@"可以接收" forState:UIControlStateNormal];
    [self.view addSubview:leftButton];
    
    UIButton *rightbutton=[UIButton buttonWithType:UIButtonTypeCustom];
    rightbutton.frame = CGRectMake(KVIEW_X(leftButton)+changespace, KVIEW_Y(alertLabel)+50, buttonWidth, buttonHeight);
    [rightbutton addTarget:self action:@selector(nocanrecieve) forControlEvents:UIControlEventTouchUpInside];
    [df layerWithView:rightbutton radius:leftButton.LC_height/2 width:1 color:RGBACOLOR(241, 241, 241, 1)];
    [rightbutton setTitleColor:[df colorWithHexString:@"999999" alpha:1] forState:UIControlStateNormal];
    [rightbutton setTitle:@"无法接收" forState:UIControlStateNormal];
    [self.view addSubview:rightbutton];
    
}

- (void)nocanrecieve{
    newChangeNoPhoneViewController *vc = [[newChangeNoPhoneViewController alloc]init];
    vc.nameTitle = @"更换登录手机号";
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)canrecieve{
    
    NewChangeHavePhoneViewController *vc = [[NewChangeHavePhoneViewController alloc]init];
    vc.nameTitle = @"更换登录手机号";
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
